﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Resources;
using System.Globalization;
using System.Threading;

namespace TVGuide.Common
{
    public class ResUtil
    {
        private string lang;
        private static Dictionary<int, string> Lang;
        static ResUtil()
        {
            Lang = new Dictionary<int, string>();
            Lang.Add(1, "hy-AM");
            Lang.Add(2, "en-US");
        }
        public ResUtil(string lang)
        {
            this.lang = lang;
        }

        public static string GetLang(int lng)
        {
            return Lang[lng];
        }

        public CultureInfo ci
        {
            get { return Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); }
        }

        /// <summary>
        /// Res. manager
        /// </summary>
        public ResourceManager com_res_man
        {
            get { return new global::System.Resources.ResourceManager("TVGuide.Common.Main", System.Reflection.Assembly.GetExecutingAssembly()); }
        }
        /// <summary>
        /// All string in UI.
        /// </summary>
        public string GetCommonResourceString(String name)
        {
            return com_res_man.GetString(name, ci);
        }

       

    }
}
